import React from "react";
import "./charRoom.scss";
import { Input, Button } from 'antd';

const { TextArea } = Input;

class UserRoom extends React.Component {
  state = {
    TextAreaValue: "",
    userLlistFlag: false,
    banWordFlag: false,
    banWord: ""
  }
  render() {
    const { roomName } = this.props;

    return (
      <div className='CR_con'>
        <div className='title'>聊天室名字{roomName}</div>

        <div className="messCon">
          <div className="con" >
            {/* <div>

            </div> */}
            {this.props.messageList && this.props.messageList.length > 0 && this.props.messageList.map((item, key) => {
              return <div className="item" key={key}>
                say:{item}
              </div>
            })}

          </div>
          <div className="inputText">
            <TextArea rows={1} onChange={(e) => {
              this.setState({
                TextAreaValue: e.target.value
              })
            }} value={this.state.TextAreaValue} />
            <Button type="primary" onClick={() => this.props.sendMess(this.state.TextAreaValue)} className="button">Send</Button>
          </div>
        </div>

      </div>
    );
  }
}

export default UserRoom;
